import { postData, getData } from '@/utils/request';

/**
 * 获取权限列表
 */
export async function menuList() {
  const result = await getData(`/permission/permissions/-1`);
  return result;
}

/** 新增
 * @param data
 * @returns
 */
export async function create(data: MenuAPI.DataType) {
  const result = await postData(`/permission/add`, data);
  return result;
}

/**
 * 更新
 * @param data
 * @returns
 */
export async function update(data: MenuAPI.DataType) {
  const result = await postData(`/permission/update`, data);
  return result;
}
